#include<bits/stdc++.h>
using namespace std;
//#define int long long
signed main() {
	int n, m;
	cin >> n >> m;

	vector<int> costN(n - 1), costM(m - 1);

	for (int i = 0; i < costN.size(); i++) {
		cin >> costN[i];
	}
	for (int i = 0; i < costM.size(); i++) {
		cin >> costM[i];
	}
	sort(costM.begin(), costM.end());
	sort(costN.begin(), costN.end());

	int t1 = 0;
	for (int i = 0; i < costN.size(); i++) {
		t1 += costN[i];
	}
	int t2 = 0;
	for (int i = 0; i < costM.size(); i++) {
		t2 += costM[i];
	}
//	cout << t1 << "  " << t2 << endl;
	cout << t2 + t1 * (costM.size() + 1) << " " << t1 + t2 * (costN.size() + 1) << endl;
	int ans = min(t2 + t1 * (costM.size() + 1), t1 + t2 * (costN.size() + 1));
	cout << ans;
	return 0;
}
